#ifndef __YOUNGTHREAD__
#define  __YOUNGTHREAD__
#include <Windows.h>

class YoungThread
{
protected:
	CRITICAL_SECTION m_ce;
	HANDLE m_hThread;
	BOOL m_bTerminated;
	typedef DWORD ( YoungThread::*ClassThreadProc)( LPVOID );
public:
	virtual void Pause();
	virtual void Continue();
	virtual void Terminated();
	virtual void WaitSync();
	virtual void WaitTerminated();
	BOOL GetTerminated();
	YoungThread();
	~YoungThread();
	void Start(LPTHREAD_START_ROUTINE lpFun = NULL);
	
protected:
	DWORD ThreadFuc(LPVOID lp);
	virtual void run();

};
#endif

